/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.baladaboa.ws.core;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Leone
 */
@Entity
@Table(name = "ponto_taxi", catalog = "dbbaladaboa", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PontoTaxi.findAll", query = "SELECT p FROM PontoTaxi p"),
    @NamedQuery(name = "PontoTaxi.findByIdpontoTaxi", query = "SELECT p FROM PontoTaxi p WHERE p.idpontoTaxi = :idpontoTaxi"),
    @NamedQuery(name = "PontoTaxi.findByNomePonto", query = "SELECT p FROM PontoTaxi p WHERE p.nomePonto = :nomePonto")})
public class PontoTaxi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idponto_taxi", nullable = false)
    private Integer idpontoTaxi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nome_ponto", nullable = false, length = 50)
    private String nomePonto;
    @OneToMany(mappedBy = "pontoTaxiIdpontoTaxi")
    private List<Contato> contatoList;
    @JoinColumn(name = "casa_idcasa", referencedColumnName = "idcasa", nullable = false)
    @ManyToOne(optional = false)
    private Casa casaIdcasa;
    @JoinColumn(name = "endereco_idendereco", referencedColumnName = "idendereco", nullable = false)
    @ManyToOne(optional = false)
    private Endereco enderecoIdendereco;

    public PontoTaxi() {
    }

    public PontoTaxi(Integer idpontoTaxi) {
        this.idpontoTaxi = idpontoTaxi;
    }

    public PontoTaxi(Integer idpontoTaxi, String nomePonto) {
        this.idpontoTaxi = idpontoTaxi;
        this.nomePonto = nomePonto;
    }

    public Integer getIdpontoTaxi() {
        return idpontoTaxi;
    }

    public void setIdpontoTaxi(Integer idpontoTaxi) {
        this.idpontoTaxi = idpontoTaxi;
    }

    public String getNomePonto() {
        return nomePonto;
    }

    public void setNomePonto(String nomePonto) {
        this.nomePonto = nomePonto;
    }

    @XmlTransient
    public List<Contato> getContatoList() {
        return contatoList;
    }

    public void setContatoList(List<Contato> contatoList) {
        this.contatoList = contatoList;
    }

    public Casa getCasaIdcasa() {
        return casaIdcasa;
    }

    public void setCasaIdcasa(Casa casaIdcasa) {
        this.casaIdcasa = casaIdcasa;
    }

    public Endereco getEnderecoIdendereco() {
        return enderecoIdendereco;
    }

    public void setEnderecoIdendereco(Endereco enderecoIdendereco) {
        this.enderecoIdendereco = enderecoIdendereco;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpontoTaxi != null ? idpontoTaxi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PontoTaxi)) {
            return false;
        }
        PontoTaxi other = (PontoTaxi) object;
        if ((this.idpontoTaxi == null && other.idpontoTaxi != null) || (this.idpontoTaxi != null && !this.idpontoTaxi.equals(other.idpontoTaxi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.baladaboa.ws.core.PontoTaxi[ idpontoTaxi=" + idpontoTaxi + " ]";
    }
    
}
